package com.xiaotu;

import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * 如何在SPringBoot启动时执行特定代码
 */
@SpringBootApplication
public class Spring330Application implements ApplicationRunner , CommandLineRunner {

	public static void main(String[] args) {
		SpringApplication.run(Spring330Application.class, args);
	}

	@Override
	public void run(ApplicationArguments args) throws Exception {
		//springboot启动完成后会调用
		System.out.println("实现ApplicationRunner");

	}

	@Override
	public void run(String... args) throws Exception {
		//springboot启动完成后会调用
		System.out.println("实现CommandLineRunner");
	}
}
